Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double trailing slash in getClusterVersion #1001

Conversation

AndreKurait
Copy link
Member

@AndreKurait AndreKurait commented Sep 24, 2024

Description

Fix double trailing slash in getClusterVersion since rest client was adding "/" which was causing 400 Bad Request in AWS against OS 2.15 (Note, was not causing issues in containers or other versions)

Bug Introduced in #922

  • Category: Bug Fix
  • Why these changes are required? AWS Opensearch Service Support
  • What is the old behavior before changes and new behavior after changes? Any Metadata Migrations to AWS Opensearch Service failed for this getVersionCall since Metadata Migration with user centric output #922

Issues Resolved

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Testing in AWS and unit tests added

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.63%. Comparing base (6c32e29) to head (33616c4).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1001      +/-   ##
============================================
+ Coverage     80.17%   89.63%   +9.46%     
============================================
  Files           370       43     -327     
  Lines         13622     2364   -11258     
  Branches        938        0     -938     
============================================
- Hits          10921     2119    -8802     
+ Misses         2130      245    -1885     
+ Partials        571        0     -571     
Flag Coverage Δ
gradle-test ?
python-test 89.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Andre Kurait <[email protected]>
@@ -67,7 +67,7 @@ protected OpenSearchClient(RestClient client, FailedRequestsLogger failedRequest
}

public Version getClusterVersion() {
return client.getAsync("/", null)
return client.getAsync("", null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. So we were doing something like curls -X GET https://<hostname>:9200//, and the double slash was accepted for self-host versions of OpenSearch, but not the managed version? That makes sense to me given all the processing they do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was accepted on everything but 2.15 managed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants